<template>
	<view>
    <view class="tabList">
      <u-tabs :list="tabList" @click="tabClick"></u-tabs>
    </view>
    <view class="team">
      <view class="team_item" v-for="item in guide_list"  @click="go_detaildy(item)">
        <image :src="item.images"  />
        <view class="name">		{{item.title}}</view>
        <view class="intro">		{{item.work_year}}</view>
      </view>
    </view>
	</view>
</template>

<script>
	import { guide_list,guidedy_list,guidedy_type } from "@/api/index.js"
	import { lists,whotellists } from '@/api/index_menu/index.js'
	export default {
		data() {
			return {
			tabList: [],
			query: {
				page: 1,
				type_id: '',
				search: ''
			},
			guide_list:[],
			}
		},
		onLoad() {
			
			// this.get_lists()
			this.guidedy_type();
			this.get_guide_list()
		},
		methods: {
				// 获取导游分类类型
						guidedy_type() {
							guidedy_type().then(res => {
								// console.log(res)
								if (res.code == 1) {
									let arr = []
									res.data.data.forEach(item => {
										item.action = false
										arr.push(item)
									})
									this.tabList = arr
								}
							})
						},
			// 获取导游列表
			get_guide_list() {
				this.status = 'loading'
				guidedy_list(this.query).then(res => {
					// console.log(res)
					if (res.code == 1) {
						if (res.data.data.length > 0) {
							this.guide_list = [...this.guide_list, ...res.data.data]
							this.query.page += 1
							this.status = 'loadmore'
						} else {
							this.status = 'nomore'
						}
					}
				})
			},
			
			  
			  tabClick(index){
			  			  console.log(index)
			  					
			  					// console.log(index,this.ticket_type_list)
			  					// this.ticket_type_list[index].action = !this.ticket_type_list[index].action
			  					// this.$forceUpdate()
			  					this.query.type_id = index.id;
			  					// this.query.type_id = this.ticket_type_list[index].id;
			  				
			  					this.query_data(this.query)
			  					
			  			},
			  			
			  			query_data(obj) {
			  				// 每次筛选清空page
			  				this.query.page = 1
			  				this.guide_list = []
			  				this.query = { ...this.query, ...obj }
			  				// console.log(this.query)
			  				this.get_guide_list()
			  			},
			  			
						go_detaildy(item) {
							uni.navigateTo({
								url: '/pagesA/index_menu/guidedy_detail?id=' + item.id
							})
						},
						
						
			  toDetail(item){
				uni.navigateTo({
				  url:'/pages/whotel/teamDetail',
				})
			  }
		}
	}
</script>

<style lang="scss">
page{
  background-color: #f5f5f5;
}
.tabList{
  background-color: white;

}
.team{
  padding: 30rpx;
  display: flex;
justify-content: space-between;
  flex-wrap: wrap;
  .team_item{
    width: 330rpx;
    background-color: white;
    border-radius: 20rpx;
    margin-bottom: 30rpx;
    padding: 30rpx;
    text-align: center;
    image{
      width: 150rpx;
      height: 150rpx;
      display: block;
      margin: auto;
	      border-radius: 50%;
    }
    .name{
      margin-top: 30rpx;
	  font-size:28rpx;
    }
    .intro{
      margin-top: 10rpx;
      color: gray;
      font-size: 26rpx;
    }
  }
}
</style>
